//package com.yunxin.core.infra.persistence.repository.channel;
//
//import com.yunxin.core.domain.model.channel.ChannelInfo;
//import com.yunxin.core.domain.model.channel.ChannelInfoRepository;
//import com.yunxin.core.infra.persistence.converter.ChannelConvertor;
//import com.yunxin.core.infra.persistence.entity.channel.ChannelInfoDO;
//import com.yunxin.core.infra.persistence.mapper.channel.ChannelInfoExtendMapper;
//import lombok.RequiredArgsConstructor;
//import org.springframework.stereotype.Repository;
//
///**
// * @author zero°
// * @since 2023-07-12
// */
//@Repository
//@RequiredArgsConstructor
//public class ChannelInfoRepositoryImpl implements ChannelInfoRepository {
//
//    private final ChannelInfoExtendMapper channelInfoExtendMapper;
//
//    private final ChannelConvertor channelConvertor;
//
//    @Override
//    public boolean saveChannel(ChannelInfo channelInfo) {
//        ChannelInfoDO channelInfoDO = channelConvertor.formChannelInfo(channelInfo);
//        int count = channelInfoExtendMapper.insertSelective(channelInfoDO);
//        channelInfo.setId(channelInfoDO.getId());
//        return count > 0;
//    }
//
//    @Override
//    public boolean updateChannel(ChannelInfo channelInfo) {
//        ChannelInfoDO channelInfoDO = channelConvertor.formChannelInfo(channelInfo);
//        int count = channelInfoExtendMapper.updateByPrimaryKeySelective(channelInfoDO);
//        return count > 0;
//    }
//
//    @Override
//    public ChannelInfo getChannelInfoByChannelCode(String channelCode) {
//        ChannelInfoDO channelInfoDO = channelInfoExtendMapper.selectChannelInfoByChannelCode(channelCode);
//        return channelConvertor.toChannelInfo(channelInfoDO);
//    }
//
//    @Override
//    public ChannelInfo getChannelInfoByChannelId(Long id) {
//        ChannelInfoDO channelInfoDO = channelInfoExtendMapper.selectByPrimaryKey(id);
//        return channelConvertor.toChannelInfo(channelInfoDO);
//    }
//}
